Skip to content

test(xsender): the extensions' integration tests answer with a fake SUNAT - #249

Merged
carlosthe19916 merged 1 commit into
mainfrom
test/hermetic-xsender-its
Nov 16, 2026
Merged

carlosthe19916 merged 1 commit into
mainfrom
test/hermetic-xsender-its

Conversation

@carlosthe19916

Copy link
Copy Markdown
Member

Why

CI on main is red with no code change involved: quarkus-extension (xsender), quarkus-supported-v (3.33.4.2) and xsender-springboot-extension all fail in sendVoidedDocument.

These integration tests sent their files to SUNAT beta. Today beta answers every comunicación de baja (sendSummary) with:

soap-env:Client.0135 El sistema no puede responder su solicitud. (No se pudo encolar el pedido)

I reproduced this outside CI three ways: with the test's fixture, with a freshly signed RA dated today, and with one rebuilt with the 2020 date. Facturas (sendBill) are still accepted. So beta's ticket queue is down, and a re-run of the jobs failed the same way. The test resource then turned the fault into a 500 (getSunat() is null for a fault).

What

These tests check the extensions' wiring (configuration → XSender → core → an answer). They now send to a local fake billService instead of SUNAT beta:

  • FakeSunat, one per IT module. It answers sendBill with a CDR and sendSummary with a ticket, using the canned answers of xsender core's tests. Any other action gets a 500.
  • Quarkus: a FakeSunatResource test resource points quarkus.xsender.company.invoice-url at the fake. It's on both the @QuarkusTest and the native @QuarkusIntegrationTest, because @WithTestResource isn't inherited. In native mode, the override reaches the binary as a system property.
  • Spring Boot: @DynamicPropertySource.
  • The voided-document tests now check the exact ticket, instead of just "not null".

SUNAT beta stays covered on demand by xsender's SunatBetaTest.

Verified

  • Locally, with beta still failing: Quarkus (current) and Spring Boot (current and 4.0.9) pass, 2 tests each.
  • Quarkus 3.33.4.2 doesn't build on my machine, with or without this change: a toolchain-only GACT cannot be cast to Comparable error. It builds in CI. Its API was checked: @WithTestResource exists there and behaves the same. This PR's CI covers it, together with the native builds.

Senior review

Two passes. Findings applied:

  • a comment on why each module has its own copy of the fake
  • only the two SOAP actions are answered, and anything else gets a 500
  • a clear error when a canned answer is missing

🤖 Generated with Claude Code

…UNAT

The Quarkus and Spring Boot integration tests sent their files to SUNAT
beta, so CI failed whenever beta did: today it answers every comunicación
de baja with 0135 "No se pudo encolar el pedido" (a fresh one too), and
main went red with no code change involved.

They test the extensions' wiring (configuration -> XSender -> core -> an
answer), so they now send to a local fake billService that answers
sendBill with a CDR and sendSummary with a ticket, from the canned answers
of xsender's core tests. The Quarkus tests point the extension at it with a
test resource, which also covers the native @QuarkusIntegrationTest; the
Spring Boot test with @DynamicPropertySource. The voided document test now
checks the ticket itself, not just that there is one. SUNAT beta stays
covered on demand by xsender's SunatBetaTest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@carlosthe19916
carlosthe19916 merged commit c63484a into main Nov 16, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant